package 每日练习;

import  java.util.Scanner;

public class text9 {
    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个整数");
        int num = sc.nextInt();

        int digit = 0;
        int place= 1;

        while(num > 0)
        {
            digit = num % 10;
            switch(place)
            {
                case 1:
                    System.out.println("个位数为" + digit);
                    break;
                case 10:
                    System.out.println("十位数为" + digit);
                    break;
                case 100:
                    System.out.println("百位数为" + digit);
                    break;
                case 1000:
                    System.out.println("千位数为" + digit);
                    break;
                case 10000:
                    System.out.println("万位数为" + digit);
                    break;
                default:
                    System.out.println(place + "位为:" + digit);
            }
            num /= 10;
            place *= 10;
        }
    }
}
